package lab02.Test11;

/**
 * Created by Administrator on 2017/11/17.
 */
public class Rectangle implements Printx{
        double a;
        double b;

        public double area(double a,double b){
            return a*b;
        }

        public double perimeter(double a,double b){
            return 2*(a*b);
        }
        @Override
    public void printMyWay() {
            System.out.println("长方形信息：");
            System.out.println("长方形边长为："+a);
            System.out.println("长方形边长为："+b);
            System.out.println("长方形面积为："+area(a,b));
            System.out.println("长方形周长为："+perimeter(a,b));
            System.out.println();
    }
}
